import request from '@/config/axios'



// 广告分类 VO
export interface CategoriesVO {
  id: number // id
  name: string // 分类名称
  value: string // 分类值
  color: string // 分类颜色
  sortOrder: number // 排序
  status: boolean // 状态
}

// 广告分类 API
export const CategoriesApi = {
  // 查询广告分类分页
  getCategoriesPage: async (params: any) => {
    return await request.get({ url: `/shequ/categories/page`, params })
  },

  // 查询广告分类详情
  getCategories: async (id: number) => {
    return await request.get({ url: `/shequ/categories/get?id=` + id })
  },
  getCategoriesList: async () => {
    return await request.get({ url: `/shequ/categories/list` })
  },

  // 新增广告分类
  createCategories: async (data: CategoriesVO) => {
    return await request.post({ url: `/shequ/categories/create`, data })
  },

  // 修改广告分类
  updateCategories: async (data: CategoriesVO) => {
    return await request.put({ url: `/shequ/categories/update`, data })
  },

  // 删除广告分类
  deleteCategories: async (id: number) => {
    return await request.delete({ url: `/shequ/categories/delete?id=` + id })
  },

  // 导出广告分类 Excel
  exportCategories: async (params) => {
    return await request.download({ url: `/shequ/categories/export-excel`, params })
  }
}
